package com.myex.demo.common.mq;

import com.myex.demo.model.OrderMsg;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MQSender {


    @Autowired
    AmqpTemplate amqpTemplate;


    //Direct模式
    public void send(OrderMsg orderMsg){
        //第一个参数队列的名字，第二个参数发出的信息
        amqpTemplate.convertAndSend(MQConfig.QUEUE,orderMsg);
    }




}
